package com.marvels.dubbo.umservice.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.fintech.user.entity.User;
import com.marvels.dubbo.umservice.service.UserInfoService;

@RestController
@RequestMapping("dubbo/um/user/service")
public class UserController {
	
	@Autowired
	private UserInfoService userInfoService;
	
	@RequestMapping("queryUserByMobileNo")
	@ResponseBody
	public User queryUserByMobileNo (@RequestParam(value="mobile",required=false) String mobile,@RequestParam(value="type",required=false) String type){
		return userInfoService.queryUserByMobileNo(mobile, type);
	}
	@RequestMapping("queryUserById")
	@ResponseBody
	public User queryUserById(@RequestParam("userId")Integer userId){
		return userInfoService.queryUserById(userId);
	}
	
	/**
	 * 插入短链接
	 * @param param
	 * @param loanId
	 */
	@RequestMapping("insertShortUrl")
	@ResponseBody
	public String insertShortUrl(@RequestParam("param")String param,@RequestParam("loanId")String loanId){
		return userInfoService.insertShortUrl(param, loanId);
	}
}
